home *** CD-ROM | disk | FTP | other *** search
/ Pro One: Netcracker Netscape Navigator / ProOne: Netcracker Netscape Navigator.iso / pc / nc / nct01110.geo / 00090.ls < prev    next >
Encoding:
Text File  |  1997-03-19  |  4.9 KB  |  214 lines

  1. on startMovie
  2.   Set_CDcounter(10)
  3.   initLesson()
  4.   CheckForTagWd()
  5. end
  6.  
  7. on HideLastStep
  8.   if Get_NEXT() = 3 then
  9.     repeat with i = 1 to 6
  10.       UpdateCursors(24 + i, 0)
  11.     end repeat
  12.   end if
  13.   if the castNum of sprite 32 = the number of cast "lamp_Off" then
  14.     UpdateCursors(32, 0)
  15.   end if
  16. end
  17.  
  18. on InitLamp
  19.   set the visible of sprite 33 to 0
  20.   set the visible of sprite 34 to 0
  21.   UpdateCursors(34, 0)
  22.   set the castNum of sprite 32 to the number of cast "lamp_Off"
  23.   UpdateCursors(32, 3)
  24. end
  25.  
  26. on unSetMouseEvents
  27.   global puppetList
  28.   set puppetList to []
  29.   repeat with i = 1 to 48
  30.     add(puppetList, the puppet of sprite i)
  31.     if not (the puppet of sprite i) then
  32.       set the puppet of sprite i to 1
  33.     end if
  34.   end repeat
  35.   play frame "outLamp"
  36. end
  37.  
  38. on setMouseEvents
  39.   global puppetList
  40.   set the mouseDownScript to EMPTY
  41.   set the mouseUpScript to EMPTY
  42.   set the keyDownScript to EMPTY
  43.   set the keyUpScript to EMPTY
  44.   repeat with i = 1 to 48
  45.     if getAt(puppetList, i) = 0 then
  46.       set the puppet of sprite i to 0
  47.     end if
  48.   end repeat
  49.   play done
  50. end
  51.  
  52. on dont
  53.   dontPassEvent()
  54. end
  55.  
  56. on HandleLamp
  57.   sound stop 1
  58.   sound stop 2
  59.   if the name of cast the castNum of sprite 32 = "lamp_On" then
  60.     set the castNum of sprite 32 to the number of cast "lamp_Off"
  61.     set the visible of sprite 33 to 0
  62.     set the visible of sprite 34 to 0
  63.     UpdateCursors(34, 0)
  64.     set the castNum of sprite 34 to the number of cast "EXITLAMP"
  65.     updateStage()
  66.     unSetMouseEvents()
  67.   else
  68.     set the castNum of sprite 32 to the number of cast "lamp_On"
  69.     UpdateCursors(34, 3)
  70.     set the visible of sprite 33 to 1
  71.     set the visible of sprite 34 to 1
  72.     updateStage()
  73.     PlaySound("NCT01110.T01")
  74.     displayTip(34)
  75.   end if
  76.   updateStage()
  77. end
  78.  
  79. on displayTip theExitBtnSp
  80.   global exitTheLoop
  81.   set exitTheLoop to 0
  82.   set the mouseDownScript to "dont"
  83.   set the mouseUpScript to "dont"
  84.   set the keyDownScript to "dont"
  85.   set the keyUpScript to "dont"
  86.   set the exitLock to 0
  87.   repeat while not exitTheLoop
  88.     if the mouseCast = the number of cast "EXITLAMP" then
  89.       set the cursor of sprite 48 to [404, 405]
  90.     else
  91.       set the cursor of sprite 48 to [400, 401]
  92.     end if
  93.     if the mouseDown and (the mouseCast = the number of cast "EXITLAMP") then
  94.       switchExitLampButt(theExitBtnSp, "EXITLAMP_D")
  95.     end if
  96.   end repeat
  97.   set the exitLock to 1
  98.   set the cursor of sprite 48 to 0
  99.   HandleLamp()
  100. end
  101.  
  102. on switchExitLampButt spriteNum, castDown
  103.   global exitTheLoop
  104.   set flag to 0
  105.   set SaveCast to the castNum of sprite spriteNum
  106.   set flag to swapExitLampCast(spriteNum, SaveCast, castDown)
  107.   repeat while the mouseDown
  108.     set flag to swapExitLampCast(spriteNum, SaveCast, castDown)
  109.   end repeat
  110.   if flag = 1 then
  111.     set exitTheLoop to 1
  112.   end if
  113. end
  114.  
  115. on swapExitLampCast spriteNum, SaveCast, castDown
  116.   if rollOver(spriteNum) then
  117.     set the castNum of sprite spriteNum to the number of cast castDown
  118.     updateStage()
  119.     return 1
  120.   else
  121.     set the castNum of sprite spriteNum to the number of cast SaveCast
  122.     updateStage()
  123.     return 0
  124.   end if
  125. end
  126.  
  127. on TheinitCursor
  128.   initCursorCastNum()
  129.   initCursorList(1)
  130.   set CursorCastNum to getCursor(2)
  131.   cursor([CursorCastNum, CursorCastNum + 1])
  132. end
  133.  
  134. on checkScreenStatus
  135.   CheckRollOver()
  136.   CheckSnakeStatus()
  137.   go(the frame)
  138. end
  139.  
  140. on BlinkNext
  141.   if (the timer > getTimer()) and not soundBusy(2) then
  142.     startTimer()
  143.     if the name of cast the castNum of sprite get_NEXTSprite() = "NEXT" then
  144.       set the castNum of sprite get_NEXTSprite() to the number of cast "NEXT_E"
  145.     else
  146.       set the castNum of sprite get_NEXTSprite() to the number of cast "NEXT"
  147.     end if
  148.   end if
  149. end
  150.  
  151. on PressBtn theBtn
  152.   Set_PressedLast(theBtn)
  153.   switchButt(Get_AnsSprite() + theBtn - 1, "down" & theBtn, "HandleBtn" && theBtn)
  154. end
  155.  
  156. on playTheTSound theTSnd
  157.   PlaySound("NCT01110.s0" & theTSnd)
  158. end
  159.  
  160. on GoNext
  161.   if not get_Disabled() then
  162.     sound stop 2
  163.     if Get_NEXT() = 3 then
  164.       GoNextMovie()
  165.     else
  166.       go("t" & Get_NEXT())
  167.     end if
  168.     Set_NEXT(Get_NEXT() + 1)
  169.   end if
  170. end
  171.  
  172. on stopMovie
  173.   sound stop 1
  174.   unLoad()
  175.   setEmptyCursor()
  176. end
  177.  
  178. on GoNextMovie
  179.   PlaySound("GOSOUND.SO1")
  180.   SaveHilite()
  181.   Add_CDcounter(1)
  182.   set cdNum to Get_CDcounter()
  183.   set movieName to item cdNum of Get_CurrentSnakeScreens()
  184.   go("INIT" & Get_ScreenSubject(), movieName & ".GEO")
  185. end
  186.  
  187. on CheckWithIn
  188.   global WasWithIn, timeoutTimer
  189.   repeat with theTsNum = 1 to 6
  190.     if theTsNum <> WasWithIn then
  191.       if (the ticks - timeoutTimer) > 120 then
  192.         set timeoutTimer to 0
  193.         if rollOver(24 + theTsNum) then
  194.           set timeoutTimer to the ticks
  195.           InitLamp()
  196.           go("t" & 3 + theTsNum)
  197.           set WasWithIn to theTsNum
  198.         end if
  199.       end if
  200.     end if
  201.   end repeat
  202. end
  203.  
  204. on blinkHiLight
  205.   if (the timer > getTimer()) and not soundBusy(2) then
  206.     startTimer()
  207.     if the visible of sprite 14 then
  208.       set the visible of sprite 14 to 0
  209.     else
  210.       set the visible of sprite 14 to 1
  211.     end if
  212.   end if
  213. end
  214.